package NewCoder;

public class BM22 {
    public int compare (String version1, String version2) {
        // write code here
        char[] c1=version1.toCharArray();
        char[] c2=version2.toCharArray();
        int n1=c1.length;
        int n2=c2.length;
        int i=0;
        int j=0;
        while(i<n1 || j<n2){
            long num1=0;
            while(i<n1 && c1[i]!='.'){
                num1=num1*10+c1[i]-'0';
                i++;
            }
            i++;

            long num2=0;
            while(j<n2 && c2[j]!='.'){
                num2=num2*10+c2[j]-'0';
                j++;
            }
            j++;

            if(num1<num2){
                return -1;
            }else if(num1 > num2){
                return 1;
            }
        }
        return 0;
    }
}
